//加载北京市边界
var borderLayer;
borderLayer = new mars3d.layer.GeoJsonLayer({
  // url: "https://wckj2020.obs.cn-south-1.myhuaweicloud.com:443/bjRegion.json",
  url: "https://wckj2020.obs.cn-south-1.myhuaweicloud.com:443/wckj/screen6-1/example/res/data/bjborder.json",
  mask: false, //标识为遮罩层【重点参数】
  name: "分区数据",
  symbol: {
    type: "polygon",
    styleOptions: {
      fill: false,
      // color: "rgb(2,26,79)",
      opacity: 0.7,
      outline: true,
      outlineColor: "#F8F8FF",
      outlineWidth: 3,
      outlineOpacity: 0.8,
      clampToGround: true,
    },
  },
});
setTimeout(function () {
  map.addLayer(borderLayer);
}, 1500);

// 显示隐藏区域边界
var shpDisplay = true;

function switchShp() {
  // clearInterval(zoneStreetChange);
  if (shpDisplay == true) {
    // if (zoneLayer.show == true) {
    clearInterval(zoneStreetChange);
    zoneLayer.show = false;
    // }
    // if (streetLayer.show == true) {
    // clearInterval(zoneStreetChange);
    streetLayer.show = false;
    shpDisplay = false;
    // }
  } else {
    shpDisplay = true;
    zoneStreetChange = setInterval(function () {
      if (map.getCameraView().alt <= 55000) {
        zoneLayer.show = false;
        streetLayer.show = true;
      } else {
        zoneLayer.show = true;
        streetLayer.show = false;
      }
    }, 1000);
  }

}